package com.mycookbook;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class FullScreenActivity extends Activity {
	/**
	 * @see android.app.Activity#onCreate(Bundle)
	 */
	
	public static final String IMAGE_PATH = "imagefilepath";
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);

	       setTheme(android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
	       getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		setContentView(R.layout.fullscreenview);
		
		Bundle extras = getIntent().getExtras();
        if(extras != null) {
            String imagePath = extras.getString(IMAGE_PATH);
            ShowImageFullScreen(imagePath);
            }
		
	}
	
	public void ShowImageFullScreen(String path){
		if(path != null) {
            ImageView i = (ImageView)findViewById(R.id.image_viewer_image);
            
            Uri imageUri = Uri.parse(path);
          
            i.setImageURI(imageUri);
            
        }
	}
}
